global keepers2006 ""


numlabel, add

*drop if panel~=2

genl yr=2006
global keepers2006 $keepers2006 yr

*genl id=v1
global keepers2006 $keepers2006 id

genl income3 = VU06_INK5
recode income3 1 2 = 0 3 = 1 4 5 = 2 9999 . = .
global keepers2006 $keepers2006 income3

genl pid_ce=(VU06_PIPA == 2 & VU06_PISA == 1)
replace pid_ce=. if (VU06_PIPA==. | VU06_PIPA>=8888)
global keepers2006 $keepers2006 pid_ce

genl pid_gov=pid_ce
global keepers2006 $keepers2006 pid_gov

genl vote = VU06_V268
*replace vote=v900 if v268==9995

genl vote_ce=vote==2
replace vote_ce=. if vote>22
global keepers2006 $keepers2006 vote_ce

genl vote_gov=vote_ce
global keepers2006 $keepers2006 vote_gov


genl gpi=VU06_V11
recode gpi 7=2.5 99=2.5
replace gpi=abs(gpi-4)/3
global keepers2006 $keepers2006 gpi

genl socref=VU06_V552
recode socref 97/99=2.5
replace socref=abs(socref-4)/3
global keepers2006 $keepers2006 socref

genl degree=VU06_V772
recode degree 10/11=1 1/9 8888=0
global keepers2006 $keepers2006 degree


// Class/occupation

gen class_reho_3cat_strata = VU06_EYRKE
recode class_reho_3cat_strata 1=1 2=1 3=2 4=2 5=1 6=2 7=2 8=. 8888/9999=.
replace class_reho_3cat_strata = . if class_reho_3cat_strata > 40
label variable class_reho_3cat_strata "Social class (3 cats.): higher value is higher class"
*label define LblClassGrade 1 "A: (Higher man.; prof." 2 "B: Lower man.; admin." 3 "C1A: Skilled; supervis. non-manu." 4 "C1B: Lower non-manu." 5 "C2: Skilled manu." 6 "D: Unskilled manu."
*label values class_head_grade LblClassGrade
global keepers2006 $keepers2006 class_reho_3cat_strata

gen male = VU06_SEX
recode male 1=1 2=0
global keepers2006 $keepers2006 male

gen married = VU06_V806
recode married 1=1 2/4=0
global keepers2006 $keepers2006 married

gen unionmem_resp = VU06_V773
recode unionmem_resp 1=1 5=0 8888=.
global keepers2006 $keepers2006 unionmem_resp

*gen unionmem_spou = v259
*recode unionmem_spou 1/4=1 .=0
*global keepers1979 $keepers1979 unionmem_spou



// Pascal/SM moderators

gen party_ID=. 
   replace party_ID=1 if  VU06_V580 ==1 & VU06_V581==1
   replace party_ID=2 if  VU06_V580 ==1 & VU06_V581==2
   replace party_ID=3 if  VU06_V580 ==1 & VU06_V581==3
   replace party_ID=4 if  VU06_V580 ==1 & VU06_V581==4
   replace party_ID=10 if  VU06_V580 ==1 & VU06_V581==5
   replace party_ID=6 if  VU06_V580 ==1 & VU06_V581==6
   replace party_ID=18 if  VU06_V580 ==1 & VU06_V581==7
   replace party_ID=19 if  VU06_V580 ==1 & VU06_V581==8
   replace party_ID=7 if  VU06_V580 ==1 & VU06_V581==9
   replace party_ID=8 if  VU06_V580 ==1 & VU06_V581==8888



 lab def party_ID 1 "v�nsterpartiet kom " 2 "socialdemokraterna" 3"centerpartiet" 4"folkpartiet" 5"h�gerpartiet" 6"kristen demokratis" 7 "other" 8 "will not answer"9 " kommunistiska f�rbundet marxist-len" 10 " moderata samlingspartiet " 11 "sveriges kommunis" 12 "borgerligt "  13 "FC+C" 14 "lokal borgerlig" 15 "sk�nepartiet" 16 "kommunistiska arbetaref�rbundet" 17 "vpk, apk, kpmlr, skp, kaf" 18 "gr�nt parti" 19 "ny demokrati"
 lab val party_ID party_ID
  tab party_ID, m
 tab party_ID VU06_V581, m


foreach var of varlist  VU06_V400 VU06_V402 VU06_V403 VU06_V405 VU06_V406 VU06_V407{
        gen Z`var'=`var'
		replace Z`var'=5 if `var'==1
		replace Z`var'=4 if `var'==2
		replace Z`var'=3 if `var'==8888 | `var'==3
		replace Z`var'=2 if `var'==4
		replace Z`var'=1 if `var'==5
		replace Z`var'=(Z`var'-1)/4
		tab Z`var' `var', m
  }


rename ZVU06_V400 cut_public
lab var cut_public "1=good idea to reduce size of public sector"

rename ZVU06_V402 cut_benefit
lab var cut_benefit "1=good idea to reduce social benefits"

rename ZVU06_V403 cut_taxes
lab var cut_taxes "1=good idea to cut taxes"

rename ZVU06_V405 privatize 
lab var privatize "1=good idea to sell public companies" 

rename ZVU06_V406 reduce_inequalities
lab var reduce_inequalities "1=good idea to reduce income differences" 

rename ZVU06_V407 private_health
lab var private_health "1=good idea to increase private run health care"


 foreach var of varlist  VU06_V551{
        gen Z`var'=`var'
		replace Z`var'=1 if `var'==4
		replace Z`var'=2 if `var'==3
		replace Z`var'=2.5 if `var'==8888
		replace Z`var'=3 if `var'==2
		replace Z`var'=4 if `var'==1
            replace Z`var'=. if `var'==6 | `var'==9 
		replace Z`var'=(Z`var'-1)/3
		tab Z`var' `var', m
  }



    rename  ZVU06_V551 econ_control
  lab var  econ_control "1=agree state control limit bank and industry influence"


foreach var of varlist    VU06_V558 VU06_V559{
        gen Z`var'=`var'/10
		replace Z`var'=0.5 if Z`var'>1
		replace Z`var'=. if `var'==.
			tab Z`var' `var', m
  }

rename ZVU06_V558 m_market_oriented
lab var m_market_oriented "1=favor move toward more free-market"


rename ZVU06_V559 m_socialism
lab var m_socialism "1=favor move toward socialism"


gen right=VU06_V1010/10
replace right=0.50 if right>1 & right~=.
replace right=. if VU06_V1010==9991
  tab right VU06_V1010, m
  lab var right "1=far right"


     gen talk_politic=.
 replace talk_politic=1 if  VU06_V12==1
 replace talk_politic=0.66 if  VU06_V12==2
replace talk_politic=0.33 if  VU06_V12==3
replace talk_politic=0 if  VU06_V12==4
replace talk_politic=0.5 if  VU06_V12==8
 replace talk_politic=. if  VU06_V12==6 |  VU06_V12==9
 
 tab  VU06_V12 talk_politic, m
  lab var talk_politic "1=often talk politic outside and inside family" 


gen newspaper_politics=.
 replace newspaper_politics=0 if VU06_V3==1
 replace newspaper_politics=0.33 if VU06_V3==2
 replace newspaper_politics=0.66 if VU06_V3==3
 replace newspaper_politics=1 if VU06_V3==4
  replace newspaper_politics=0.5 if VU06_V3==8
tab newspaper_politics VU06_V3,m
 lab var newspaper_politics "1=read more politic articles"



gen newspaper_regular=1 if VU06_V2==1
replace newspaper_regular=0 if VU06_V2==5
tab newspaper_regular VU06_V2, m

 lab var newspaper_regular "1=regularly read daily news paper"

 
 
 
gen anti_m_socialism=.
replace anti_m_socialism=0 if m_socialism==1
replace anti_m_socialism=0.1 if m_socialism>=0.88 & m_socialism<=0.91 
replace anti_m_socialism=0.2 if m_socialism>=0.78 & m_socialism<=0.81 
replace anti_m_socialism=0.3 if m_socialism>=0.68 & m_socialism<=0.71 
replace anti_m_socialism=0.4 if m_socialism>=0.58 & m_socialism<=0.61 
replace anti_m_socialism=0.5 if m_socialism>=0.48 & m_socialism<=0.51 
replace anti_m_socialism=0.6 if m_socialism>=0.38 & m_socialism<=0.41 
replace anti_m_socialism=0.7 if m_socialism>=0.28 & m_socialism<=0.31 
replace anti_m_socialism=0.8 if m_socialism>=0.18 & m_socialism<=0.21 
replace anti_m_socialism=0.9 if m_socialism>=0.08 & m_socialism<=0.11 
replace anti_m_socialism=1 if m_socialism==0
tab anti_m_socialism m_socialism, m

gen index_interest=(gpi+talk_politic+newspaper_politics)/3
global keepers2006 $keepers2006 index_interest

gen index_market_oriented=( socref+ cut_public+ cut_benefit+ cut_taxes+ privatize + private_health+ m_market_oriented+ anti_m_socialism +right )/9
global keepers2006 $keepers2006 index_market_oriented
